/**
 * 
 */
package com.none.web.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author steve
 * 
 */
/**
 * @author porterzhang
 * 
 */
@Entity
@Table(name = "t_beacon")
public class TBeacon implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3006881392414685626L;
	// Fields
	private String beaconId; // 设备表编号
	private String iBeaconId; // 设备的全ID
	private String proximityUUID; // 设备的udid
	private String major; // 主要的
	private String minor; // 次要
	private Float in_distance; // 最近距离
	private Float out_distance; // 最远
	private String instruction; // 弹出页面时间
	private String pop_message;// 弹出内容
	private String pop_image; // 弹出图片
	private String pop_times; // 弹出时间
	private Boolean active;// 是否启用
	// private Set<TNews> TNews = new HashSet<TNews>(0);
	private TNews tnews;
	private Integer sendNum=0;//发送新闻次数，默认0，就无数次，每接触一次发送一次

	public TBeacon() {
		super();
	}
	

	public TBeacon(String beaconId, String proximityUUID, String major, String minor, Float in_distance,
			Float out_distance, String instruction, String pop_message, String pop_image, String pop_times,
			Boolean active, String iBeaconId, TNews TNews) {
		super();
		this.beaconId = beaconId;
		this.proximityUUID = proximityUUID;
		this.major = major;
		this.minor = minor;
		this.tnews = TNews;
		this.active = active;
		this.in_distance = in_distance;
		this.out_distance = out_distance;
		this.instruction = instruction;
		this.pop_message = pop_message;
		this.pop_image = pop_image;
		this.pop_times = pop_times;
		this.iBeaconId = iBeaconId;
	}

	@Id
	@Column(name = "beacon_id", unique = true, nullable = false, length = 32)
	public String getBeaconId() {
		return beaconId;
	}

	public void setBeaconId(String beaconId) {
		this.beaconId = beaconId;
	}

	@Column(name = "proximityUUID", length = 100)
	public String getProximityUUID() {
		return proximityUUID;
	}

	public void setProximityUUID(String proximityUUID) {
		this.proximityUUID = proximityUUID;
	}

	@Column(name = "major", length = 8)
	public String getMajor() {
		return major;
	}

	public void setMajor(String major) {
		this.major = major;
	}

	@Column(name = "minor", length = 8)
	public String getMinor() {
		return minor;
	}

	public void setMinor(String minor) {
		this.minor = minor;
	}

	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY)
	@JoinColumn(name = "news_id")
	public TNews getTnews() {
		return tnews;
	}

	public void setTnews(TNews tnews) {
		this.tnews = tnews;
	}

	@Column(name = "in_distance")
	public Float getIn_distance() {
		return in_distance;
	}

	public void setIn_distance(Float in_distance) {
		this.in_distance = in_distance;
	}

	@Column(name = "out_distance")
	public Float getOut_distance() {
		return out_distance;
	}

	public void setOut_distance(Float out_distance) {
		this.out_distance = out_distance;
	}

	@Column(name = "instruction", length = 100)
	public String getInstruction() {
		return instruction;
	}

	public void setInstruction(String instruction) {
		this.instruction = instruction;
	}

	@Column(name = "pop_message", length = 1000)
	public String getPop_message() {
		return pop_message;
	}

	public void setPop_message(String pop_message) {
		this.pop_message = pop_message;
	}

	@Column(name = "pop_image", length = 300)
	public String getPop_image() {
		return pop_image;
	}

	public void setPop_image(String pop_image) {
		this.pop_image = pop_image;
	}

	@Column(name = "pop_times")
	public String getPop_times() {
		return pop_times;
	}

	public void setPop_times(String pop_times) {
		this.pop_times = pop_times;
	}

	@Column(name = "active")
	public Boolean getActive() {
		return active;
	}

	public void setActive(Boolean active) {
		this.active = active;
	}

	@Column(name = "ibeacon_id", length = 100)
	public String getiBeaconId() {
		return iBeaconId;
	}

	public void setiBeaconId(String iBeaconId) {
		this.iBeaconId = iBeaconId;
	}

	@Column(name = "send_num")
	public Integer getSendNum() {
		return sendNum;
	}

	
	public void setSendNum(Integer sendNum) {
		this.sendNum = sendNum;
	}
	
}
